package leetcode.code0242;

import leetcode.IDebug;

public class Solution implements IDebug {

	public boolean isAnagram(String s, String t) {
		int[] dics = new int[26];
		char[] cs = s.toCharArray();
		for (int i = 0; i < cs.length; i++) {
			dics[cs[i] - 'a']++;
		}
		cs = t.toCharArray();
		for (int i = 0; i < cs.length; i++) {
			dics[cs[i] - 'a']--;
		}
		for (int i = 0; i < 26; i++) {
			int cur = dics[i];
			if (cur != 0) {
				return false;
			}
		}
		return true;
	}

	@Override
	public void debug1() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug2() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug3() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub

	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
